package Stringclass;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class class8work{
	static String a;
	static String[] str1 = new String[2];
	public static void strw() {
		Random r = new Random();
		List<String> ls = new ArrayList<>();
		for (int i = 48; i < 58; i++) {
			ls.add(String.valueOf((char)i));
		}
		for (int j = 65; j < 91; j++) {
			ls.add(String.valueOf((char)j));
		}
		for (int k = 97; k < 122; k++) {
			ls.add(String.valueOf((char)k));
		}
		
			String rr1 = ls.get(r.nextInt(ls.size()));
			String rr2 = ls.get(r.nextInt(ls.size()));
			String rr3 = rr1+rr2;
			//
			a=rr3;
		    //System.out.print(rr3);

	}
		public static void main(String[] args) {
			String[] str = new String[100];
			for (int i = 0; i < 100; i++) {
			 strw();
			 str[i]=a;
			
			}
				for (int j = 0; j < str.length; j++) {
				System.out.print(str[j]);
				System.out.printf(" ");
			}
			boolean ye  = false;
			int counts = 0;
			for (int i = 0; i < str.length-1; i++) {
				for (int j = i+1; j < str.length; j++) {
					if(str[i].equals(str[j])) {
						//ye = true;
						counts++;
						System.out.println(str[i]);
						break;
					}
				}
			}
			
			System.out.println(counts);

			
		}
}
